x86/mem_sharing: block interrupt injection for forks
authorTamas K Lengyel <tamas.lengyel@intel.com>
Tue, 16 Jun 2020 08:29:16 +0000 (10:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 16 Jun 2020 08:29:16 +0000 (10:29 +0200)
commit3371ced37ced359167b5a71abee2062854371323
tree86ca5de4526552c6c041eba02cd685079cb224a5
parent1251402caf8685f45d9d580f01583370f7e2d272
x86/mem_sharing: block interrupt injection for forks

When running VM forks without device models (QEMU), it may
be undesirable for Xen to inject interrupts. When creating such forks from
Windows VMs we have observed the kernel trying to process interrupts
immediately after the fork is executed. However without QEMU running such
interrupt handling may not be possible because it may attempt to interact with
devices that are not emulated by a backend. In the best case scenario such
interrupt handling would only present a detour in the VM forks' execution
flow, but in the worst case as we actually observed can completely stall it.
By disabling interrupt injection a fuzzer can exercise the target code without
interference. For other use-cases this option probably doesn't make sense,
that's why this is not enabled by default.

Forks & memory sharing are only available on Intel CPUs so this only applies
to vmx. Note that this is part of the experimental VM forking feature that's
completely disabled by default and can only be enabled by using
XEN_CONFIG_EXPERT during compile time.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Paul Durrant <paul@xen.org>
xen/arch/x86/hvm/vmx/intr.c
xen/arch/x86/mm/mem_sharing.c
xen/include/asm-x86/hvm/domain.h
xen/include/public/memory.h